findMonitorForActor() may be called before the layoutManager gets
to initialize monitors, so make sure the monitor index is in range
to avoid a warning.
https://bugzilla.gnome.org/show_bug.cgi?id=781471
},
findMonitorForActor: function(actor) {
- return this.monitors[this.findIndexForActor(actor)];
+ let index = this.findIndexForActor(actor);
+ if (index >= 0 && index < this.monitors.length)
+ return this.monitors[index];
+ return null;
},
_queueUpdateRegions: function() {